home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 33
/
033.d81
/
vertical bar dem
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
1KB
|
46 lines
5 poke53280,6:poke53281,6
10 print"[147]";:dim a%(15),d%(72)
15 print" vertical bar chart demo"
20 print"f[155]ull or h[155]alf column? (f[155]/h[155]) [164][157]";
22 geta$:ifa$<>"h"anda$<>"f"then22
23 printa$
25 ifa$="h"thenpm=1:goto40
30 print"[155]dual color? (y[155]/n[155]) [164][157]";
32 getq$:ifq$<>"y"andq$<>"n"then32
33 printq$
35 if q$="y" then dc=3
40 print"zero bottom? (y[155]/n[155]) [164][157]";
42 getq$:ifq$<>"y"andq$<>"n"then42
43 printq$
45 if q$="n" then z=1
50 nb=36:i=2:if b or dc then nb=72:i=1
60 for x=1 to nb step 2:d%(x)=(40*rnd(1)+1)*z: rem bottom
70 d%(x+1)=d%(x)+99*rnd(1)+8: rem top
80 if d%(x+1)>d%(0) then d%(0)=d%(x+1): rem highest top
90 next
100 data 97,126,97,123
110 for x=0to3:read a%(x):next:r=2
120 if b=0 then for x=0to15:read a%(x):next:r=8
130 data 224,228,239,249,226,120,119,99,224,100,111,121,98,248,247,227
140 hv=r*20:s%=1+d%(0)/hv:iv=s%*r
150 print chr$(147)"demo chart":for x=1 to 40:l$=l$+chr$(164):next
160 for x=20 to 0 step-1:x$=mid$(str$(iv*x),2)
170 p$=x$+left$(l$,40-len(x$)):print p$;:next:x%=1
175 print"[145] ";
176 print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][145]";
180 for x=1 to nb step 2:b%=d%(x)/s%:t%=d%(x+1)/s%
190 e=b%-(int(b%/r)*r):gosub240:e=r
200 b%=b%+r:if b%<t% then gosub 240:goto 200
210 b%=t%:e=t%-(int(t%/r)*r):if e then e=e+r:gosub 240
220 if dc then cc=abs(cc-1)
230 x%=x%+i:next:goto300
240 y%=b%/r:sa=1866-(y%*40)+x%:poke sa,a%(e):ifpmthenpokesa+1,a%(e)
250 pokesa+54272,dc-cc:ifpmthenpokesa+54272+1,dc-cc
260 return
300 print"[154] press [159]a [154]to see another demo, [159]q [154]to quit"
310 geta$:ifa$<>"a"anda$<>"q"then310
320 ifa$="a"thenrun
330 print"[147]";:open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
335 ifer<>63thenend
340 load"hello connect",8